/*
package com.csyf.manager.controller.api;

import com.csyf.manager.channel.base.BaseReturn;
import com.csyf.manager.channel.base.PayInfoReturn;
import com.csyf.manager.channel.unionpay.H5RequestVo;
import com.csyf.manager.service.OrderBiz;
import com.csyf.manager.utils.SignUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.Valid;

*/
/**
 * @Author: Enzo
 * @Date: 2018/4/8 16:34
 *//*

@Slf4j
@Controller
@RequestMapping(value = "/api/v1/")
public class ApiUnionPayController extends ApiBaseController {


    @Autowired
    private OrderBiz orderBiz;

    @ResponseBody
    @RequestMapping(value = "h5wkpay")
    public BaseReturn h5wkpay(@Valid H5RequestVo vo, BindingResult bindingResult) {
        try {
            validateHibernate(bindingResult);

            validmerchid(vo.getMch_id());

            validservice(vo.getMch_id(),vo.getService());


            validsign(vo,vo.getMch_id(),vo.getSign());

            String order = orderBiz.createOrder(vo);

            PayInfoReturn payInfoReturn = new PayInfoReturn();
            payInfoReturn.setPayinfo(order);
            payInfoReturn.setRet_code("SUCCESS");
            payInfoReturn.setOrderNo(vo.getOut_trade_no());
            payInfoReturn.setRet_message("请求成功");
            payInfoReturn.setMch_id(vo.getMch_id());
            payInfoReturn.setTotal_fee(vo.getTotal_fee());
            String sign = SignUtils.objectsign(payInfoReturn, getAgentSignKey(vo.getMch_id()));

            payInfoReturn.setSign(sign);
            return payInfoReturn;
        } catch (Exception e) {
//            e.printStackTrace();

            BaseReturn baseReturn = new BaseReturn();
            baseReturn.setRet_code("FAIL");
            baseReturn.setRet_message(e.getMessage());
            log.error("h5wkpay",e);
            return baseReturn;
        }
    }
}
*/
